package cn.controller.product;

import cn.service.productService.ProductServiceImpl.ProductServiceImpl;
import entity.productEntity.Condition;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/23 14:06
 */
@RestController
@CrossOrigin
@RequestMapping("/product")
public class ProductController {
    @Autowired
    ProductServiceImpl service;
    @RequestMapping("/getformjson")
    public Result getformjson(@RequestBody String jsonObject){
        return service.getformjson(jsonObject);
    }
    @RequestMapping("/updateformjson")
    public Result updateformjson(@RequestBody String jsonObject){
        return service.updateformjson(jsonObject);
    }
    @RequestMapping("/getproducts")
    public Result getproducts(@RequestBody Condition condition){
        return service.getproducts(condition);
    }
    @RequestMapping("/updatepublish_status")
    public Result updatepublish_status(Integer id,Integer value){
        return service.updatepublish_status(id,value);
    }
    @RequestMapping("/updatenew_status")
    public Result updatenew_status(Integer id,Integer value){
        return service.updatenew_status(id,value);
    }
    @RequestMapping("/updaterecommand_status")
    public Result updaterecommand_status(Integer id,Integer value){
        return service.updaterecommand_status(id,value);
    }
    @RequestMapping("/deleteproduct")
    public Result deleteproduct(Integer id){
        return service.deleteproduct(id);
    }
    @RequestMapping("/getproductinfo")
    public Result getproductinfo(Integer id){
        return service.getproductinfo(id);
    }
    @RequestMapping("/getserviceinfo")
    public Result getserviceinfo(Integer id){
        return service.getserviceinfo(id);
    }
    @RequestMapping("/getattributeinfo")
    public Result getattributeinfo(Integer id){
        return service.getattributeinfo(id);
    }
}
